Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

137
Vistas
Reading from Clipboard on Chrome Extension returns "pending" Promise

I'm trying to read from the clipboard on my Chrome extension. I'm using the navigator.clipboard.readText() method from the ClipboardAPI to do so (because document.execCommand('paste') is deprecated). However, not only does the method fail to ask for user permission to read from clipboard (as done on regular web apps), but all it returns is a "pending" promise that does not get fulfilled nor rejected.

Here's the code block I'm running on a function. Neither the clipboardString variable nor err variable gets logged on the console. And the method itself returns a promise that remains "pending" forever.

    navigator.clipboard
      .readText()
      .then((clipboardString) => {
        console.log('Clipboard Contains: ', clipboardString);
      })
      .catch((err) => {
        console.log('Clipboard Error: ', err);
      });

Any solutions to this problem? Either what's happening with this pending promise or how to read from clipboard on a Chrome extension? Thank you.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda